package com.yanqu.road.server.cmd.cross.marriage;

import com.yanqu.road.pb.marriage.CrossMarriageProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.marriage.MarriageMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import io.netty.channel.ChannelHandlerContext;


@Cmd(code = Protocol.S_CROSS_MARRIAGE_REFUSE_NOTIFY_SERVER, desc = "跨服联姻拒绝通知")
public class CrossMarriageRefuseNotifyServerCmd implements Command {
	@Override
	public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
		CrossMarriageProto.CrossMarriageRefuseNotifyListMsg reqMsg = CrossMarriageProto.CrossMarriageRefuseNotifyListMsg.parseFrom(packet.getBytes());
		for(CrossMarriageProto.CrossMarriageRefuseNotifyTempMsg tempMsg : reqMsg.getDataListList()){
			MarriageMgr.refuseCrossMarriage(tempMsg.getUserId(), tempMsg.getChildUidList());
		}
	}
}
